<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="root" value="<%=request.getContextPath()%>" />
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>登录 - 尾矿库监控系统</title>

<meta name="description" content="User login page" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<!-- basic styles -->

<link href="${root}/resources/css/bootstrap.min.css" rel="stylesheet" />
<link href="${root}/resources/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="${root}/resources/css/font-awesome.min.css" />

<!--[if IE 7]>
		  <link rel="stylesheet" href="resources/css/font-awesome-ie7.min.css" />
		<![endif]-->
<!-- page specific plugin styles -->
<!-- fonts -->
<link rel="stylesheet" href="${root}/resources/css/google-fonts.css" />
<!-- ace styles -->
<link rel="stylesheet" href="${root}/resources/css/ace.min.css" />
<link rel="stylesheet" href="${root}/resources/css/ace-rtl.min.css" />
<!--[if lte IE 8]>
		  <link rel="stylesheet" href="${root}/resources/css/ace-ie.min.css" />
		<![endif]-->
<!-- inline styles related to this page -->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
		<script src="${root}/resources/js/html5shiv.js"></script>
		<script src="${root}/resources/js/respond.min.js"></script>
		<![endif]-->
<style>
.Three-Dee {
	font-family: Garamond, serif;
	line-height: 1em;
	color: #FF6347;
	font-weight: bold;
	font-size: 42px;
	text-shadow: 0px 0px 0 rgb(-26, 229, -26), 1px 1px 0 rgb(-34, 221, -34),
		2px 2px 0 rgb(-42, 213, -42), 3px 3px 0 rgb(-50, 205, -50), 4px 4px 0
		rgb(-58, 197, -58), 5px 5px 0 rgb(-66, 189, -66), 6px 6px 0
		rgb(-74, 181, -74), 7px 7px 6px rgba(0, 0, 0, 0.15), 7px 7px 1px
		rgba(0, 0, 0, 0.5), 0px 0px 6px rgba(0, 0, 0, .2);
}
</style>
</head>

<body class="login-layout" style="background-image:url(${root}/resources/images/bj.jpg);background-repeat:no-repeat;background-size:100% 100%;">
	<div class="main-container">
		<div class="main-content">
			<div class="row">
				<div class="col-sm-10 col-sm-offset-1">
					<div class="login-container">
						<div class="center">
							<h4 class="blue">&nbsp;</h4>
							<h1>
								<i class="icon-leaf green"></i> <span class="Three-Dee">尾矿库监测系统</span>
							</h1>
							<h4 class="blue">&nbsp;</h4>
						</div>

						<div class="space-6"></div>

						<div class="position-relative">
							<div id="login-box" class="login-box visible  widget-box no-border">
								<div class="widget-body">
									<div class="widget-main">
										<h4 class="header blue lighter bigger">
											<i class="icon-user green"></i> 请输入用户名,密码
										</h4>

										<div class="space-6"></div>

										<form id="myform">
											<fieldset>
												<label class="block clearfix"> <span class="block input-icon input-icon-right"> <input type="text" class="form-control" name="username" placeholder="用户名" /> <i
														class="icon-user"></i>
												</span>
												</label> <label class="block clearfix"> <span class="block input-icon input-icon-right"> <input type="password" class="form-control" name="password" placeholder="密码" />
														<i class="icon-lock"></i>
												</span>
												</label>

												<div class="space"></div>

												<div class="clearfix">

													<button id="loginbutton" type="button" onclick="login();" class="width-35 pull-right btn btn-sm btn-primary">
														<i class="icon-key"></i> 登 录
													</button>
												</div>

												<div class="space-4"></div>
											</fieldset>
										</form>

									</div>
									<!-- /widget-main -->

									<div class="toolbar clearfix">
										<div style="width:50px;">
											<a href="javascript:void(0)" class="forgot-password-link"> </a>
										</div>

										<div style="width:300px;">
											<a href="javascript:void(0)" onclick="show_box('signup-box'); return false;" class="user-signup-link"> &copy; 贵州大唐卫通工业有限公司 </a>
										</div>
									</div>
								</div>
								<!-- /widget-body -->
							</div>
							<!-- /login-box -->
						</div>
						<!-- /position-relative -->
					</div>
				</div>
				<!-- /.col -->
			</div>
			<!-- /.row -->
		</div>
	</div>
	<!-- /.main-container -->
	<!-- basic scripts -->
	<!--[if !IE]> -->
	<script src="${root}/resources/js/jquery-2.0.3.min.js"></script>
	<!-- <![endif]-->
	<!--[if IE]>
		<script src="${root}/resources/js/jquery-1.10.2.min.js"></script>
		<![endif]-->
	<script type="text/javascript">
		if ("ontouchend" in document)
			document.write("<script src='${root}/resources/js/jquery.mobile.custom.min.js'>" + "<"+"/script>");
	</script>
	<script src="${root}/resources/js/bootstrap.min.js"></script>
	<script src="${root}/resources/myjs/my_noty.js"></script>
	<!-- inline scripts related to this page -->
	<script type="text/javascript">
		function login() {
			$('#loginbutton').popover('destroy');
			$.ajax({
				contentType : "application/x-www-form-urlencoded; charset=utf-8",
				type : 'post',
				data : $('#myform').serialize(),
				url : '${root}/letsgo?se=' + new Date().getTime(),
				success : function(data) {
					if (data == '0') {
						window.location.href = "${root}/";
					} else if (data == '2') {
						_noty($('#loginbutton'), '该用户被禁用！', 'left', 2000);
					} else if (data == '3') { // 序列号过期或没输入
						window.location.href = "${root}/register";
					} else {
						_noty($('#loginbutton'), '用户名或密码错误！', 'left', 2000);
					}
				},
				error : function(req) {
					_noty($('#loginbutton'), '服务器异常！！', 'left', 2000);
				},
				complete : function(XHR, TS) {
					XHR = null
				}
			});
		}
	</script>
</body>
</html>
